package com.asa.chainmapview

import android.graphics.Canvas
import android.graphics.Color
import android.graphics.Paint
import android.graphics.Path


/**
 * create By：anderson
 * on 2022/3/19
 * desc:
 */
class ProvinceItem(val drawColor:Int,val path: Path) {

    fun drawMap(canvas: Canvas?,paint: Paint,isSelect:Boolean){
        canvas?.also { canvas ->
            if (isSelect){
                //绘制边界
                paint.clearShadowLayer();
                paint.strokeWidth = 2f
                val color = 0xFFD0E8F4
                paint.color = color.toInt()
                paint.style = Paint.Style.STROKE
                canvas.drawPath(path,paint)


                //绘制内部区域
                paint.strokeWidth = 1f
                paint.color = drawColor
                paint.style = Paint.Style.FILL
                canvas.drawPath(path,paint)
            } else{
                paint.strokeWidth = 2f
                paint.color = Color.BLACK
                paint.style = Paint.Style.FILL
                paint.setShadowLayer(8f,0f,0f,0xffffff);
                canvas.drawPath(path,paint);

//            绘制边界
                paint.clearShadowLayer();
                paint.color = drawColor;
                paint.style = Paint.Style.FILL;
                paint.strokeWidth = 2f;
                canvas.drawPath(path, paint);
            }

        }
    }


}